package Q168

/**
 * Excel表列名称
 * @author 23737
 * @date 2022.5.5
 */
class Main {

}

fun main(){

}

class Solution {
    fun convertToTitle(columnNumber: Int): String {
        var columnNumber = columnNumber
        if(columnNumber == 0){
            return " "
        }
        val sb : StringBuilder = java.lang.StringBuilder()
        while(columnNumber > 0){
            columnNumber --
            sb.append((columnNumber % 26 + 'A'.toInt()).toChar())
            columnNumber /= 26
        }
        return sb.reverse().toString()
    }
}
